<template>
	<view class="content">
		<u-navbar
			title="反馈与意见"
			:autoBack="true"
			:placeholder="true"
		>
		</u-navbar>
		<view class="text-textarea">
			<u--textarea v-model="formdata.intcontent" height="150" maxlength="300" placeholder="Hi,请输入你对同彩迷城的反馈和建议吧〜" count border="none"></u--textarea>
		</view>
		<view class="text-input">
		  <u--input
			placeholder="联系方式(手机号码/邮箱/QQ/微信)"
			border="none"
			v-model="formdata.linked"
			placeholderStyle="font-size:22rpx;color:#c0c4cc"
		  ></u--input>
		</view>
		<view class="okbtn">
		<u-button color='#025E21' text="确定" :disabled="show" @click='stbtn'></u-button>
		</view>
		</view>
</template>

<script>
	export default{
		data(){
			return{
				formdata:{
					intcontent:'',
					linked:''
				},
				show:true
			}
		},
		watch:{
			formdata:{
				handler:function(newval,_){
					if(newval.intcontent.length > 8 && newval.linked.length>8){
						this.show = false
					}else{
						this.show = true
					}
				},
				deep:true
			}
		},
		methods:{
			stbtn(){
				uni.showToast({
					title:'反馈成功',
					icon:'success'
				})
				this.formdata = {
					intcontent:'',
					linked:''
				}
			}
		},
		onBackPress(options) {
			console.log('from:' + options.from)
		}
	}
</script>

<style>
	page{
		background-color: #fafafa;
	}
	.content{
		padding: 0 40rpx;
	}
	.text-textarea{
		margin-top: 50rpx;
		border-radius: 20rpx;
		overflow: hidden;
	}
	.text-input{
		margin-top: 30rpx;
		background-color: #fff;
		border-radius: 10rpx;
	}
	.u-input{
		padding: 10rpx !important;
	}
	.okbtn{
		margin-top: 60rpx;
	}
</style>